Writing your own macros: the normalshapemediumseries\catcode problems

As seen before, the normalshapemediumseriesnormalshapemediumseries\catcodes of the normalshapemediumseries|| and normalshapemediumseries& symbols are modified by MusicTEX, in the range of the actual scores but no more2.28 in the whole of the TEX source. Thus, if you define your own macros to make your writing easier, you are likely to invoke the normalshapemediumseries|| or normalshapemediumseries& symbols in a part of text where their normalshapemediumseriesnormalshapemediumseries\catcodes are not correctly set. This may result typically in a diagnostic like :

! Misplaced alignment tab character &.

when you attempt, not to define, but to use your macro using the normalshapemediumseries& symbol to change the instrument. Smart TEXers know that the normalshapemediumseriesnormalshapemediumseries\catcodes are attached to the characters when they are input and not when they are used; thus you must be sure that normalshapemediumseries|| and normalshapemediumseries& have the correct MusicTEX normalshapemediumseriesnormalshapemediumseries\catcode when the macro is defined, which may well occur outside the actual score.

It is also worth pointing out that the same problem may occur with other punctuation marks like ``normalshapemediumseries<'', ``normalshapemediumseries>'', ``^, etc., if their normalshapemediumseriesnormalshapemediumseries\catcode has been changed by some other set of macros, like normalshapemediumseriesfrench.sty.